package cn.stylefeng.guns.modular.api.model;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@SuppressWarnings("rawtypes")
@ApiModel
public class ModelDTO implements Comparable{

	public ModelDTO(String title, String value, Integer pri, Date createTime, String pageType) {
		this.title = title;
		this.value = value;
		this.pri = pri;
		this.createTime = createTime;
		this.pageType = pageType;
	}
	
	@ApiModelProperty("标题")
	private String title;
	@ApiModelProperty("点击跳转地址")
	private String value;
	@ApiModelProperty("创建时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date createTime;
	@ApiModelProperty("排序号")
	private Integer pri;
	@ApiModelProperty("页面类型")
	private String pageType;
	
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getValue() {
		return value;
	}
	
	public void setValue(String value) {
		this.value = value;
	}
	
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getPri() {
		return pri;
	}

	public void setPri(Integer pri) {
		this.pri = pri;
	}

	public String getPageType() {
		return pageType;
	}

	public void setPageType(String pageType) {
		this.pageType = pageType;
	}

	@Override
	public int compareTo(Object o) {
		if(o instanceof ModelDTO){
			ModelDTO emp = (ModelDTO) o;
			return this.pri.compareTo(emp.pri);
        }
		return 0;
	}
	
}
